package com.qzdsoft.erpcloud.service.sys.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qzdsoft.erpcloud.domain.sys.SysRoleTableField;
import com.qzdsoft.erpcloud.mapper.sys.SysRoleTableFieldMapper;
import com.qzdsoft.erpcloud.service.sys.SysRoleTableFieldService;
import com.qzdsoft.vo.Response;

/**
 * 
 * 表格字段权限维护service
 *
 * <p>detailed comment
 * @author pc-20170420 2017年9月15日
 * @see
 * @since 1.0
 */
@Service
public class SysRoleTableFieldServiceImpl implements SysRoleTableFieldService {

    @Autowired
    private SysRoleTableFieldMapper sysRoleTableFieldMapper;

    @Override
    public SysRoleTableField selectById(Integer id) {
        return sysRoleTableFieldMapper.selectByPrimaryKey(id);
    }

    @Override
    public Response saveOrUpd(SysRoleTableField sysRoleTableField) {
//        if(null != sysRoleTableField.getId()){
//            sysRoleTableFieldMapper.updateByPrimaryKey(sysRoleTableField);
//        } else {
//            sysRoleTableFieldMapper.insert(sysRoleTableField);
//        }
        return Response.success(null);
    }

    @Override
    public Response del(Integer id) {
        sysRoleTableFieldMapper.deleteByPrimaryKey(id);
        return Response.success(null);
    }
}
